package com.test.feigndemo.controller;

import com.demo.feign.OrderFeignService;
import com.test.common.utils.R;

import com.test.feigndemo.vo.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    OrderFeignService orderFeignService;


    /**
     *测试接口
     * @param id
     * @return
     */
    @RequestMapping(value = "/getOrderByUserId/{id}")
    public R  getOrderByUserId(@PathVariable("id") Integer id) {
        //feign调用
        R result = orderFeignService.findOrderByUserId(id);
        return result;
    }

    @RequestMapping(value = "/findOrderByUserId/{id}")
    public OrderVo findOrderByUserId(@PathVariable("id") Integer id) {

        System.out.println("执行业务");

        //模拟业务
        OrderVo vo = new OrderVo();

        return vo;
    }
    
    
//    @RequestMapping(value = "/save")
//    public R save(@RequestBody OrderVo order){
//        return orderFeignService.save(order);
//    }
    
   
}
